include "ServiceBase.thrift"

namespace cpp jztzp
namespace java com.jztzp

struct ArticleMeta {
  // denomoralization, 保存作者完整信息
  1: required i64 id;
  2: required i32 state;
  3: required i32 article_id;
  4: required i32 sender_id;
  5: required string sender_name;
  6: required string sender_ip;
  7: required i32 time_stamp;
  8: required string content;
}

struct ArticleResult {
  1: required bool success;
  2: optional string reason;
  3: optional ArticleMeta meta;
  4: optional string content;
}

service ArticleMain extends ServiceBase.ServiceBase {
  ArticleResult Get(1: i32 id);
  ArticleResult GetMeta(1: i32 id);

  ArticleResult GetContent(1: i32 id);
  i32 UpdateContent(1: i32 id, 2: string content);
}

